﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DXApplicationTangche.DTO.坚山
{
    public class DTO坚山款式
    {
        private List<DTO款式> dTO款式s = new List<DTO款式>();
        private List<DTO版型> dTO版型s = new List<DTO版型>();
        private List<DTO面料> dTO面料s = new List<DTO面料>();
        private List<DTO制作工艺> dTO制作工艺s = new List<DTO制作工艺>();
        private List<DTO款式类别> dTO款式类别s = new List<DTO款式类别>();
        private List<String> 刺绣设计点 = new List<string>();

        public String key { get; set; } //  生产计划针对工艺路线配置的ID
        public List<DTO款式> DTO款式s { get => dTO款式s; set => dTO款式s = value; } //  K:版型，V：款式
        public List<DTO版型> DTO版型s { get => dTO版型s; set => dTO版型s = value; }
        public List<DTO面料> DTO面料s { get => dTO面料s; set => dTO面料s = value; }
        public List<DTO制作工艺> DTO制作工艺s { get => dTO制作工艺s; set => dTO制作工艺s = value; }
        public List<DTO款式类别> DTO款式类别s { get => dTO款式类别s; set => dTO款式类别s = value; }
        public List<string> 刺绣设计点s { get => 刺绣设计点; set => 刺绣设计点 = value; }

        /// <summary>
        /// 根据款式找
        /// </summary>
        /// <param name="款式"></param>
        /// <returns></returns>
        public DTO版型 getDTO版型By款式(String 款式) {

            foreach (DTO款式 DTO款式 in dTO款式s) {
                if (款式.Equals(DTO款式.Name)) {
                    foreach (DTO版型 DTO版型 in this.dTO版型s) {
                        if (DTO款式.ID.Equals(DTO版型.Code)) {
                            return DTO版型;
                        }
                    }
                    
                }
            }
            throw new Exception("数据异常");
        }
    }

    public class DTO款式{ 
        public String ID { get; set; }  //  款式
        public String Name { get; set; }    //  版型
        public DTO款式(String ID, String Name) {
            this.ID = ID;
            this.Name = Name;
        }
    }

    public class DTO版型
    {
        public String ID { get; set; }
        public String Code { get; set; }
        public String Name { get; set; }
        public DTO版型(String ID,String Code, String Name)
        {
            this.ID = ID;
            this.Code = Code;
            this.Name = Name;
        }
    }

    public class DTO面料
    {
        public String ID { get; set; }
        public String Code { get; set; }
        public String Name { get; set; }
        public DTO面料(String ID, String Name, String Code)
        {
            this.ID = ID;
            this.Name = Name;
            this.Code = Code;
        }
    }

    public class DTO制作工艺
    {
        public String ID { get; set; }
        public String Name { get; set; }
        public DTO制作工艺(String ID, String Name)
        {
            this.ID = ID;
            this.Name = Name;
        }
    }


    public class DTO款式类别
    {
        public String ID { get; set; }
        public String Name { get; set; }
        public DTO款式类别(String ID, String Name)
        {
            this.ID = ID;
            this.Name = Name;
        }
    }
}
